Imports System.Collections.Generic

Imports System.Web

#Region "using"
Imports System.Data
Imports QUANLY.DAO
Imports QUANLY.DTO
#End Region
Public Class TOUR_DIADIEMBUS
    Private objDAO As TOUR_DIADIEMDAO
    Public Sub New(ByVal strPath As [String])
        objDAO = New TOUR_DIADIEMDAO(strPath)
    End Sub

    Public Function SelectAll() As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectAll()
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function

    Public Function SelectByID(ByVal id As Integer) As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectByID(id)
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function

    Public Function Insert(ByVal obj As TOUR_DIADIEMDTO) As Boolean
        Try
            Return objDAO.Insert(obj)
        Catch
            Return False
        End Try
    End Function

    Public Function Delete(ByVal id As Integer) As Boolean
        Try
            Return objDAO.Delete(id)
        Catch
            Return False
        End Try
    End Function

    Public Function DeleteByIDTour(ByVal idtour As Integer) As Boolean
        Try
            Return objDAO.DeleteByIDTour(idtour)
        Catch
            Return False
        End Try
    End Function

    Public Function Update(ByVal obj As TOUR_DIADIEMDTO) As Boolean
        Try
            Return objDAO.Update(obj)
        Catch
            Return False
        End Try
    End Function

    Public Function SelectByIDLoTrinh(ByVal idlotrinh As Integer) As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectByIDLoTrinh(idlotrinh)
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function

    Public Function SelectByIDDiaDiem(ByVal iddiadiem As Integer) As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectByIDDiaDiem(iddiadiem)
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function

    Public Function SelectByIDTour(ByVal idtour As Integer) As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectByIDTour(idtour)
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function
End Class
